package org.apache.solr.ocean.replication;

import java.io.InputStream;

import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.ContentStream;
import org.apache.solr.handler.RequestHandlerBase;
import org.apache.solr.handler.RequestHandlerUtils;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrQueryResponse;

/**
 * Handles incoming replication requests
 */
public class TransactionPushRequestHandler extends RequestHandlerBase {
  public void handleRequestBody(SolrQueryRequest request, SolrQueryResponse response) throws Exception {
    RequestHandlerUtils.addExperimentalFormatWarning(response);
    SolrParams params = request.getParams();
    Iterable<ContentStream> streams = request.getContentStreams();
    if (streams == null) {
      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "missing content stream");
    } else {
      for (ContentStream stream : request.getContentStreams()) {
        InputStream input = stream.getStream();
        
      }
    }
  }
  
  public String getDescription() {
    return "";
  }
  
  public String getSourceId() {
    return "";
  }
  
  public String getSource() {
    return "";
  }
  
  public String getVersion() {
    return "1.0";
  }
}
